From dd97a8ab23c1bf95dc9b02b8be44b18289f05709 Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 28 Sep 2005 21:24:05 +0000 Subject: [PATCH] Move global decls to a file of their own. --- gpsbabel/Makefile | 5 +++-- gpsbabel/globals.c | 28 ++++++++++++++++++++++++++++ gpsbabel/main.c | 9 +++------ 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 gpsbabel/globals.c diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index ff057fe2b..6c5f13879 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -61,7 +61,7 @@ LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \ csv_util.o strptime.o grtcirc.o vmem.o util_crc.o xmlgeneric.o \ uuid.o formspec.o xmltag.o cet.o cet_util.o \ $(COLDSYNC) $(GARMIN) $(JEEPS) $(SHAPE) $(FMTS) $(FILTERS) -OBJS = main.o $(LIBOBJS) +OBJS = main.o globals.o $(LIBOBJS) .c.o: $(CC) -c $(CFLAGS) $< $(OUTPUT_SWITCH)$@ @@ -78,7 +78,7 @@ usbfree: gpsbabel: $(OBJS) $(CC) $(CFLAGS) $(OBJS) $(LIBEXPAT) $(LIBUSB) -lm $(OUTPUT_SWITCH)$@ -main.o: +globals.o: $(CC) -c $(CFLAGS) -DVERSION=\"$(VERSIOND)\" $< $(OUTPUT_SWITCH)$@ clean: @@ -185,6 +185,7 @@ gdb.o: gdb.c defs.h queue.h gbtypes.h garmin_tables.h jeeps/gpsmath.h \ geo.o: geo.c defs.h queue.h gbtypes.h xmlgeneric.h geoniche.o: geoniche.c defs.h queue.h gbtypes.h coldsync/palm.h \ coldsync/pdb.h +globals.o: globals.c defs.h queue.h gbtypes.h glogbook.o: glogbook.c defs.h queue.h gbtypes.h xmlgeneric.h google.o: google.c defs.h queue.h gbtypes.h xmlgeneric.h gpilots.o: gpilots.c defs.h queue.h gbtypes.h coldsync/palm.h \ diff --git a/gpsbabel/globals.c b/gpsbabel/globals.c new file mode 100644 index 000000000..e2329a9b5 --- /dev/null +++ b/gpsbabel/globals.c @@ -0,0 +1,28 @@ +/* + Global data for GSPBabel. + + Copyright (C) 2005 Robert Lipe, robertlipe@usa.net + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA + + */ + + +#include "defs.h" + +global_options global_opts; +const char gpsbabel_version[] = VERSION; + + diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 3806061b6..06e732571 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -23,14 +23,11 @@ #include "cet_util.h" #include -global_options global_opts; -const char gpsbabel_version[] = VERSION; - static void usage(const char *pname, int shorter) { printf("GPSBabel Version %s. http://www.gpsbabel.org\n\n", - VERSION ); + gpsbabel_version ); printf( "Usage:\n" " %s [options] -i INTYPE -f INFILE -o OUTTYPE -F OUTFILE\n" @@ -137,7 +134,7 @@ main(int argc, char *argv[]) } if (argv[argn][1] == 'V' ) { - printf("\nGPSBabel Version %s\n\n", VERSION ); + printf("\nGPSBabel Version %s\n\n", gpsbabel_version ); exit(0); } @@ -284,7 +281,7 @@ main(int argc, char *argv[]) * When debugging, announce version. */ if (global_opts.debug_level > 0) { - warning("GPSBabel Version: " VERSION "\n" ); + warning("GPSBabel Version: %s \n", gpsbabel_version ); } break; -- 2.30.2